#!/usr/bin/env python
# Create: 2018/8/10
__author__ = '749B'

from crm import models
from steed_admin import base_admin


class CustomerAdmin(base_admin.ModelAdmin):
    list_display = ('name', 'qq', 'consultant', 'source', 'consult_content', 'status', 'date')
    list_filter = ('source', 'status', 'consultant')
    search_fields = ('qq', 'name')
    list_editable = ('status',)
    list_per_page = 2


class ClassListAdmin(base_admin.ModelAdmin):
    list_display = ('course', 'semester', 'branch')
    list_filter = ('class_type',)
    filter_horizontal = ('teachers',)


class CourseRecordAdmin(base_admin.ModelAdmin):
    list_display = ('class_grade', 'day_number')
    default_actions = ()


base_admin.site.register(models.Customer, CustomerAdmin)
base_admin.site.register(models.Course)
base_admin.site.register(models.ClassList, ClassListAdmin)
base_admin.site.register(models.CourseRecord, CourseRecordAdmin)


